package system

import (
	"github.com/gogf/gf/v2/frame/g"
	"server/api"
)

type AdminCreateReq struct {
	g.Meta   `path:"/system/admin/create" tags:"系统管理-用户" method:"post" summary:"新增" dc:"创建系统账号"`
	Username string  `v:"required" dc:"用户名"`
	Name     string  `v:"required" dc:"姓名"`
	Phone    string  `v:"" dc:"手机号"`
	RoleIds  []int64 `v:"" dc:"角色ID"`
	Avatar   string  `v:"" dc:"用户头像"`
}
type AdminCreateRes struct {
	Id int64 `json:"id"`
}

type AdminUpdateReq struct {
	g.Meta   `path:"/system/admin/update" tags:"系统管理-用户" method:"post" summary:"修改" dc:"修改系统账号基本信息"`
	Id       int64   `v:"required" dc:"用户ID"`
	Username string  `v:"required" dc:"用户名"`
	Name     string  `v:"required" dc:"姓名"`
	Phone    string  `v:"" dc:"手机号"`
	RoleIds  []int64 `v:"" dc:"角色ID"`
	Avatar   string  `v:"" dc:"头像"`
}
type AdminUpdateRes struct {
}

type AdminDeleteReq struct {
	g.Meta `path:"/system/admin/delete" tags:"系统管理-用户" method:"post" summary:"删除"`
	Id     int64 `v:"required"`
}
type AdminDeleteRes struct {
}

type AdminListReq struct {
	g.Meta `path:"/system/admin/list" tags:"系统管理-用户" method:"GET" summary:"列表"`
	api.PagerReq
	Keyword  string `dc:"关键词"`
	RoleIds  []int  `dc:"角色ID"`
	Username string `dc:"用户账号"`
	Phone    string `dc:"手机号"`
}
type AdminListRes struct {
	api.PagerRes
}

type AdminResetPasswordReq struct {
	g.Meta `path:"/system/admin/resetPassword" tags:"系统管理-用户" method:"post" summary:"重置密码"`
	Id     int64 `v:"required"`
}
type AdminResetPasswordRes struct {
}

type AdminChangePasswordReq struct {
	g.Meta          `path:"/system/admin/changePassword" tags:"系统管理-用户" method:"post" summary:"重置密码" description:"后台系统账号密码初始化"`
	Id              int64  `v:"required"`
	Password        string `v:"required|length:6,32#密码请输入密码|长度应当在:6到32之间" dc:"密码"`
	ConfirmPassword string `v:"required|same:password#请再次输入密码|两次密码不一致，请重新输入" dc:"重复密码"`
}
type AdminChangePasswordRes struct {
}

type AdminUpdateUserReq struct {
	g.Meta `path:"/system/admin/updateUser" tags:"系统管理-用户" method:"post" summary:"重置密码" description:"修改个人基本信息"`
	Id     int64  `v:"required"`
	Name   string `v:"required" dc:"姓名"`
	Phone  string `v:"" dc:"手机号"`
	Avatar string `v:"" dc:"头像"`
}
type AdminUpdateUserRes struct {
}
